<div class="bjui-pageContent">
    <form action="{:U('save_ad')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
        <input type="hidden" name="id" value="{$va.id}"/>
        <div class="form-group">
            <label class="x100">广告名称:</label>
            <input type="text" name="name" data-rule="required" class="w400" value="{$va.name}"/>
        </div>
        <div class="form-group">
            <label class="x100">位置:</label>
            <select name="place_id" data-toggle="selectpicker">
                <option value="">--请选择--</option>
                <volist name="res" id="vo">
                <option value="{$vo.id}" <if condition="$va['place_id'] eq $vo['id']">selected</if>>{$vo.name}</option>
                </volist>
            </select>
            <span class="text-warning">注:如果某个位置只支持显示一张图片,而实际添加了两个广告,那么将会随机显示其中一个</span>
        </div>
        <div class="form-group">
            <label class="x100">开始时间:</label>
            <input type="text" name="start_time" data-rule="required" data-toggle="datepicker" data-pattern="yyyy-MM-dd" value="{$va.start_time}"/>
        </div>
        <div class="form-group">
            <label class="x100">结束时间:</label>
            <input type="text" name="end_time" data-rule="required" data-toggle="datepicker" data-pattern="yyyy-MM-dd" value="{$va.end_time}"/>
        </div>
        <div class="form-group clearfix">
            <label class="x100 pull-left">上传图片:</label>
            <div class="pull-left parent_img">
                <if condition="$va.photo neq null">
                <img src="{$va.photo}" alt="LOGO" width="70" />
                <else/>
                <img src="__MK__/image/58008889b30bc.jpg" alt="LOGO" width="70" />
                </if>
                <input type="hidden" name="photo" value="{$va.photo}" />
                <span data-toggle="upload" 
                data-uploader="{:U('Index/upload')}"
                 data-file-type-exts="*.png;*.jpg"
                 data-icon="cloud-upload"
                 data-on-upload-success="upload_callback"
                 data-auto="true"
                 data-button-text="上传图片"
                ></span>
            </div>
        </div>
        <div class="form-group">
            <label class="x100">广告连接:</label>
            <input type="text" name="url"  class="w400" value="{$va.url}"/>
        </div>
        <div class="form-group">
            <label class="x100">状态:</label>
            <input type="radio" name="status" value="0" id="adv_status1" data-toggle="icheck" data-label="显示"  <if condition="$va.status neq '1'"> checked</if>  />
            <input type="radio" name="status" value="1" id="adv_status2" data-toggle="icheck" data-label="不显示" <if condition="$va.status eq '1'"> checked</if>   />
        </div>
        <div class="form-group">
            <label class="x100">权重:</label>
            <input type="text" name="sort"  value="{$va.sort}" data-toggle="spinner" data-min="0" data-step="1" data-rule="integer" class="w100"  />
        </div>
    </form>
</div>
<include file="Common/footer" ftype="save" />